<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../Template/TemplateAdmin.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="content">
        <center>
            <f:view>
                <h:form>
                    <h1><h:outputLabel value="WELCOME TO ADMIN WEB!"/></h1>
                    <p:panelGrid columns="1" style="width: 780px">
                        <f:facet name="header">  
                            List All Account 
                        </f:facet>  
                        <p:dataTable id="dataTable" value="#{accountBean.allAccounts}" var="item" selectionMode="single"
                                     rowKey="#{item.accountID}" selection="#{accountBean.selectAccount}" style="width: 780px ;font-size:10px;font-weight: 10px"
                                     paginator="true" rows="10" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15">
                            <p:column id="modelHeader" sortBy="#{item.accountID}">
                                <f:facet name="header">
                                    <h:outputText value="AccountID"/>
                                </f:facet>
                                <h:outputText value="#{item.accountID}"/>
                            </p:column>
                            <p:column sortBy="#{item.fullName}">
                                <f:facet name="header">
                                    <h:outputText value="FullName"/>
                                </f:facet>
                                <h:outputText value="#{item.fullName}"/>
                            </p:column>

                            <p:column sortBy="#{item.telephoneNumber}">
                                <f:facet name="header">
                                    <h:outputText value="TelephoneNumber"/>
                                </f:facet>
                                <h:outputText value="#{item.telephoneNumber}"/>
                            </p:column>
                            <p:column sortBy="#{item.email}">
                                <f:facet name="header">
                                    <h:outputText value="Email"/>
                                </f:facet>
                                <h:outputText value="#{item.email}"/>
                            </p:column>
                            <p:column sortBy="#{item.status}">
                                <f:facet name="header">
                                    <h:outputText value="Status"/>
                                </f:facet>
                                <p:selectBooleanCheckbox value="#{item.status}"/>
                            </p:column>
                            <p:column sortBy="#{item.roleID.roleName}">
                                <f:facet name="header">
                                    <h:outputText value="RoleID"/>
                                </f:facet>
                                <h:outputText value="#{item.roleID.roleName}"/>
                            </p:column>
                            <p:column sortBy="#{item.departmentID.departmentName}">
                                <f:facet name="header">
                                    <h:outputText value="DepartmentID"/>
                                </f:facet>
                                <h:outputText value="#{item.departmentID.departmentName}"/>
                            </p:column>

                        </p:dataTable>
                        <f:facet name="footer">  
                            <p:commandButton action="#{accountBean.viewDetailAcc()}" value="View Detail" style="margin:0"/>
                            <p:commandButton action="#{accountBean.create()}" value="Create New" style="margin:0"/>
                            <p:commandButton value="Deleted"  style="margin:0"/>  
                        </f:facet>  
                    </p:panelGrid>
                    


                </h:form>
            </f:view>
        </center>
    </ui:define>

</ui:composition>
